#!/usr/bin/env python
'''Select a color'''

__author__ = "Miki Tebeka <miki.tebeka@gmail.com>"
__license__ = "BSD" # see LICENSE

import Tkinter as tk
from tkColorChooser import askcolor

def main(argv=None):
    if argv is None:
        import sys
        argv = sys.argv

    from optparse import OptionParser

    parser = OptionParser("usage: %prog")

    opts, args = parser.parse_args(argv[1:])
    if len(args) != 0:
        parser.error("wrong number of arguments") # Will exit

    root = tk.Tk()
    root.iconify()
    rgb, hex = askcolor()

    # Past to color to clipboard
    if hex:
        print str(hex).upper()

if __name__ == "__main__":
    main()
